<link rel="icon" href="__PUBLIC__/web/images/favicon.ico" type="image/x-icon">
<div class="ly-logo">
    <a href="{:U('Web/Index/home')}"><img src="__PUBLIC__/web/images/logo.png" title="氦闪"/></a>
</div>
<div class="ly-top">
    <if condition="$member_info.mid eq ''">
        <!-- 未登录状态-->
        <ul class="ly-menu">
            <li><a href="{:U('Index/personal')}">个人中心</a></li>
            <li><a href="{:U('Index/login')}">登录</a></li>
            <li><a href="{:U('Index/register')}">注册</a></li>
        </ul>
        <else/>
        <!--登录状态-->
        <ul class="ly-menu">
        <li><a style="color: #d43f3a" href="{:U('Index/user_info')}">{$member_info.nickname}</a></li>
        <li><a href="{:U('Index/contact')}">联系我们</a></li>
        <!--<li><a href="{:U('Index/follow')}">关注氦闪</a></li>-->
        <li><a href="javascript:;" class="loginOut">退出登录</a></li>
        </ul>
    </if>


    <div class="ly-shop-car">
        <a href="{:U('Cart/shop')}"><img src="__PUBLIC__/web/images/icon_car.png"/><span>{$cart_number}</span></a>
    </div>
</div>
<script src="__PUBLIC__/web/js/jquery.min.js"></script>

<script>
    $('.loginOut').click(function () {
        $.ajax({
            url: "{:U('Index/userLoginOut')}",
            dataType: "json",
            data: {},
            type: 'POST',
            async: true,
            beforeSend: function () {

//                $("body").showLoading();
            },
            success: function (rst) {
                console.log(rst);
                if (rst.code == '200') {
                    window.location.href="{:U('Index/home')}";
                }
            },
            error: function () {
//                $("body").hideLoading();
//                    alert("错误");
            }

        });
    })
</script>